<?php
/**
 * Offre les objets formulaires html5
 * 
 * BphForm
 * BphFieldSet
 * Bphlabel
 */
 
define('ENC_URL', "application/x-www-form-urlencoded");
define('ENC_DATA', "multipart/form-data");
define('ENC_PLAIN', "text/plain");

/**
 * Implemente l'objet form
 */
class BphForm extends BphItemBox{
	/**
	 * Constructeur
	 */
	function __Construct($pname, $paction, $pmethod='post', $pnovalidate=False, $penctype=ENC_URL){
		parent::__Construct('form');
		$this->AddAttribut('name', $pname);
		$this->AddAttribut('action', $paction);
		$this->AddAttribut('method', $pmethod);
		$this->AddAttribut('novalidate', $pnovalidate);
		$this->AddAttribut('enctype', $penctype);
	}
}//class BphForm


/**
 * Implemente l'objet FieldSet
 */
class BphFieldSet extends BphItemBox{
	/**
	 * Constructeur
	 */
	function __Construct($plegend=''){
		parent::__Construct('fieldset');
		if ( $plegend ){
			$this->AddItems(new BphItemBox('legend', $plegend));
		}
	}
}//class BphFieldSet


/**
 * Implemente l'objet Label
 */
class BphLabel extends BphItemBox{
	/**
	 * Constructeur
	 */
	function __Construct($ptext, $pfor='', $pform=''){
		parent::__Construct('label');
		if ($ptext)
			$this->AddItems($ptext);
		$this->AddAttribut('for', $pfor);
		$this->AddAttribut('form', $pform);
	}
}//class BphLabel
?>
